package com.zzty.zzlp.dao;

import com.zzty.zzlp.entity.Twitter;
import com.zzty.zzlp.entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

public interface TwitterMapper {

    @Select("select * from twitter ")
    public List<Twitter> selectAll();

    @Select("select * from twitter where author =  #{author}")
    public List<Twitter> selectSelf(@Param("author") Integer author);


    @Insert("insert into twitter(content,img,author,time)values(#{content},#{img},#{author},#{time})")
    public void insertTwitter(Twitter twitter);

    @Delete("delete from twitter where id = #{id} and author = #{author}")
    public void deleteByIdAndAuthor(Integer id, Integer author);
}
